package com.formula.datastructure.question.tree;

import com.formula.datastructure.standard.tree.binary.BinarySortTree;
import com.formula.datastructure.util.DataUtil;

// BST
public class Quest11 {
    public static void main(String[] args) {
        BinarySortTree tree = new BinarySortTree();
        Integer[] input = DataUtil.genUniqueArray(15, 300);
        for (Integer item : input) {
            tree.insert(item);
        }
        DataUtil.printList(tree.getSort());
        System.out.println("The value will be deleted: " + input[12]);
        if(tree.delete(input[12])){
            // 删除了仍是顺序排列
            DataUtil.printList(tree.getSort());
        }
    }
}
